using UnityEngine;
using UnityEngine.Rendering;
namespace WzhModule.GM
{
    [UnityEngine.Scripting.Preserve]
    [WzhGMClass("Main", 5)]
    public class MainGMDebug : WzhGMMenu
    {

        [WzhGMMethod("FPS30")]
        public void FPS60Dem30()
        {
            Application.targetFrameRate = 30;
            OnDemandRendering.renderFrameInterval = 2;
        }

        [WzhGMMethod("FPS60")]
        public void FPS60Dem60()
        {
            Application.targetFrameRate = 60;
            OnDemandRendering.renderFrameInterval = 1;
        }

        [WzhGMMethod("Set FPS")]
        public void SetFPS()
        {
            var res = 30;
            if (int_TextValue > 0) res = int_TextValue;
            Application.targetFrameRate = res;
            OnDemandRendering.renderFrameInterval = 0;
        }

        [WzhGMMethod("SetLogFalse")]
        public void SetLogFalse()
        {
            Debug.unityLogger.logEnabled = false;
        }

        [WzhGMMethod("+金币")]
        public void AddMoneyGold()
        {
            if (string.IsNullOrEmpty(string_TextValue)) return;
            //WzhModule.I.GameData.mGoods.AddMoney(addNum,true, Vector3.zero);
            //WzhModule.I.GameData.mGoods.AddGoodsByGoodsID(ConstantModule.Goods.MoneyID, string_TextValue, true);
        }

        [WzhGMMethod("设置对应数值金币")]
        public void SetMoenyData()
        {
            if (int_TextValue <= 0) return;
            //LongBig addNum = new LongBig(int_TextValue);
            //WzhModule.I.GameData.mGoods.SetMoney(addNum,true);
        }

        [WzhGMMiniMethod("增加游戏速度")]
        public void DebugTimeAdd()
        {
            Time.timeScale += 0.5f;
        }
        [WzhGMMiniMethod("减少游戏速度")]
        public void DebugTimeLess()
        {
            if (Time.timeScale >= 1)
            {
                Time.timeScale -= 0.5f;
            }
            else
            {
                if (Time.timeScale > 0.15f)
                {
                    Time.timeScale -= 0.1f;
                }
            }
        }
        [WzhGMMiniMethod("还原游戏速度")]
        public void DebugTimeRest()
        {
            Time.timeScale = 1;
        }

    }
}